package com.platform.qujia.service;



import com.platform.qujia.param.request.AutoPayWay;
import com.platform.qujia.pojo.ClassSettlement;
import com.platform.qujia.pojo.ClassSettlementCard;
import com.platform.qujia.pojo.ClassSettlementOilmachine;
import com.platform.qujia.pojo.CustomerPointsRecordApi;
import com.platform.qujia.pojo.dto.CardClassSettDto;
import com.platform.qujia.utils.BGResult;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 班结Service接口
 * 
 * @author qujia
 * @date 2021-11-27
 */
public interface ClassSettlementService
{


    /**
     * 查询班结汇总列表
     *
     * @param classSettlement 班结
     * @return 班结集合
     */
    public List<ClassSettlement> selectClassSettlementSummaryList(ClassSettlement classSettlement);

    public List<ClassSettlement> selectClassSettlementSummary4POSList(Map<String, Object> params);
    public List<ClassSettlement> selectClassSettlement4User4POSList(Map<String, Object> params);
    public void selectChange4User4POSListForOrder(Map<String,Object> params);
    public void insertAboutOil(Map<String,Object> params,String no,String classEndTime,Long stationId);
    public BigDecimal forKillCouponAmt(Map<String, Object> params);
    public ClassSettlement querySuperPay(Map<String, Object> params);
    /**
     * 新增班结
     *
     * @param classSettlement 班结
     * @return 结果
     */
    public int insertClassSettlement(ClassSettlement classSettlement);

    /**
     * 新增油机班结
     *
     * @param classSettlementOilmachine 班结
     * @return 结果
     */
    public int insertClassSettlementOilmachine(ClassSettlementOilmachine classSettlementOilmachine);

    public List<ClassSettlementOilmachine> selectAllClassSettlementOilmachines(String classNo);

    public BigDecimal forActualRechargeReceivedAmt(BigDecimal actualRechargeReceivedAmt,Map<String, Object> params);

    /**
     * 查询未班结信息
     *
     * @param params
     * @return 结果
     */
    public List<ClassSettlement> queryUntreatedData(Map<String, Object> params);
    /***
     * 充值合计(包括退款)
     * @param params
     * @return
     */
    BigDecimal getTotalAmtByConditions(Map<String, Object> params);

    //统计是白班还是夜班
    public String queryClassDayOrNight(Long stationId, Date createEndTime);


    BigDecimal getTotalPresentAmtByConditions(Map<String, Object> params);
    /**
     * 查询通联支付的订单信息
     *
     * @param params
     * @return 结果
     */
    public List<ClassSettlement> queryPayWayData(Map<String, Object> params);

    /**
     * 查询最近的班结信息
     *
     * @param classSettlement
     * @return 结果
     */
    public ClassSettlement QueryMaxClass(ClassSettlement classSettlement);

    public Map<String,Object> queryLastEndTime(Map<String, Object> params);

    public List<Map<String,Object>> queryGroupByPayType(Map<String,Object> params);

    public List<Map<String,Object>> queryGroupByUser(Map<String,Object> params);

    /**
     * 调用后台接口，创建班结
     * @return classNo
     */
    String createClassSettlementBGApi(ClassSettlement classSettlement);


    BGResult customerPointsRecordApi(CustomerPointsRecordApi customerPointsRecordApi);




    /**
     * 调用后台接口，创建班结
     * @return classNo
     */
    void changeAutoPayWayBGApi(AutoPayWay autoPayWay);

    /**
     * 调用后台接口，查询班结数据
     * @param classNo
     * @return
     */
    Map<String,Object> getClassSettlementInfoBGApi(String classNo);

    Map<String,Object> getClassSettlementInfo(String classNo);


    Map<String,Object> createAndGetClassSettlement(ClassSettlement classSettlement);

    List<ClassSettlementCard> getTransactionSummary(CardClassSettDto settDto, Map<String, Object> params);

    List<ClassSettlement> querySummaryByClassNoAllData(Map<String,Object> params,CardClassSettDto settDto);

    List<String> queryClassNoByPayDate(Integer stationId,Date payDate);

    int updateClassSettlementStatus(String classNo);
}
